package com.cqut.mapper;

import com.cqut.VO.course.CourseDetailsVO;
import com.cqut.VO.course.CourseListDisplayVO;
import com.cqut.entity.UserCourse;
import com.cqut.VO.courseMemberInfo.StudentInfoVO;
import com.cqut.VO.courseMemberInfo.TeacherInfoVO;
import com.cqut.entity.Course;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 冯永龙
 * @since 2021-06-15
 */
public interface CourseMapper {
    /**
     * 获取所有课程
     *
     * @param userId
     * @param type
     * @return
     */
    List<CourseListDisplayVO> getCourses(int userId, int type);

    /**
     * 删除用户的课程记录
     *
     * @param id
     * @return
     */
    int deleteUserCourseById(int id);

    /**
     * 根据id删除课程
     *
     * @param id
     * @return
     */
    int deleteCourseById(int id);

    /**
     * 更新课程
     *
     * @param course
     * @return
     */
    int updateCourse(Course course);

    /**
     * 添加课程
     *
     * @param course
     * @return
     */
    int insertCourse(Course course);

    int addCourse(Integer courseId, Integer userId, Integer type, String enterTime, Integer sort);

    List<TeacherInfoVO> getTeachTeamListByCourseId(Integer courseId);

    List<StudentInfoVO> getStudentListByCourseId(Integer courseId);

    int updateRankCourse(List<UserCourse> courses);

    CourseDetailsVO getCourseDetailsByCourseId(Integer courseId);

    int getStudentNumberByCourseId(Integer courseId);

    Integer getCourseIdByCourseCode(String courseCode);

    int quitCourseByCourseIdAndUserId(Integer courseId, Integer userId);

    Object getStudentInCourse(Integer courseId, Integer userId);

}
